//
//  ESCardHoroscopeView.m
//  EasyStyle
//
//  Created by FK on 16/1/20.
//  Copyright © 2016年 FK. All rights reserved.
//

#import "ESCardHoroscopeView.h"
#import "ESHoroscopeNetResult.h"

@interface ESCardHoroscopeView ()
@property (weak, nonatomic) IBOutlet UIView *bgView;
@property (weak, nonatomic) IBOutlet UIButton *coverBtn;

//@property (weak, nonatomic) IBOutlet UILabel *consName;

@property (weak, nonatomic) IBOutlet UIImageView *horoscopeImage;

@property (weak, nonatomic) IBOutlet UILabel *synthesisIndex;           // 综合指数
@property (weak, nonatomic) IBOutlet UILabel *workingIndex;             // 工作指数
@property (weak, nonatomic) IBOutlet UILabel *lovingIndex;              // 爱情指数
@property (weak, nonatomic) IBOutlet UILabel *wealthIndex;              // 财富指数



@end

@implementation ESCardHoroscopeView

- (void)awakeFromNib
{
    self.backgroundColor = [UIColor colorWithHex:@"ebfafa"];
    self.layer.cornerRadius = 3.0;
    
    self.bgView.backgroundColor = [UIColor colorWithHex:@"ebfafa"];
    self.bgView.layer.cornerRadius = 3.0;
    
    [_coverBtn addTarget:self action:@selector(showHoroscopeDetail) forControlEvents:UIControlEventTouchUpInside];
}


- (void)loadCardWithData:(NSDictionary *)dictResult
{
    ESHoroscopeNetResult *result = [ESHoroscopeNetResult new];
    [result parseNetResult:dictResult];
    
//    _consName.text = result.name;
    
    _horoscopeImage.image = [UIImage imageNamed:result.name];
    
    _synthesisIndex.text = result.all;
    
    _workingIndex.text = result.work;
    
    _lovingIndex.text = result.love;
    
    _wealthIndex.text = result.money;
}

- (void)showHoroscopeDetail
{
    if (_blockHoroscopeDetail) {
        _blockHoroscopeDetail();
    }
}

@end
